package com.fenxiangle.yueding.feature.order.view.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fenxiangle.yueding.R;
import com.fenxiangle.yueding.common.util.DateTool;
import com.fenxiangle.yueding.common.widget.RatingBar;
import com.fenxiangle.yueding.entity.bo.CommentBo;
import com.suozhang.framework.framework.AM;

import java.util.Date;

public class MyRatingAdapter extends BaseQuickAdapter<CommentBo,BaseViewHolder> {
    public MyRatingAdapter() {
        super(R.layout.item_my_rating);
    }

    @Override
    protected void convert(BaseViewHolder helper, CommentBo item) {
        RatingBar ratingBar=helper.getView(R.id.rb_queestion_comment_star);
        ratingBar.setStar(item.getScore());
        AM.image().bindToCircleObject(item.getUserHead(),helper.getView(R.id.iv_my_rating_head));

         helper.setText(R.id.tv_my_publish_username, item.getUserName())
                .setText(R.id.tv_my_publish_credit,"信用分："+item.getCreditScore())
         .setText(R.id.tv_my_publish_date, DateTool.formatTime4(item.getScoreTime()));
    }
}
